﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace Subtle.Domain.Models
{
	/// <summary>
	/// Post
	/// </summary>
	public class Post
	{
		public virtual int ID { get; set; }
		[Required]
		public virtual string Title { get; set; }
		public virtual string SanitizedTitle { get; set; }
		public virtual string Body { get; set; }
		public virtual DateTime DateCreated { get; set; }
		public virtual DateTime PublishDate { get; set; }
		public virtual bool Active { get; set; }
		
		[Required]
		public virtual Category Category { get; set; }

		[Required]
		public virtual User User { get; set; }
		[Required]
		public virtual IList<Tag> Tags { get; set; }

		/// <summary>
		/// Initializes a new Post
		/// </summary>
		public Post()
		{
			PublishDate = DateTime.Now;
			DateCreated = DateTime.Now;
			Tags = new List<Tag>();
			Category = new Category();
		}
	}
}
